<!doctype html public "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd">
<html>
<head>
<title>
 Overview
</title>
<link rel ="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script>
function asd() {
	
		parent.document.title="events.js Overview";
	
}
</script>
</head>
<body bgcolor="white" onload="asd();">

<!-- ========== START OF NAVBAR ========== -->
<a name="navbar_top"><!-- --></a>
<table border="0" width="100%" cellpadding="1" cellspacing="0">
<tr>
<td colspan=2 bgcolor="#EEEEFF" class="NavBarCell1">
<a name="navbar_top_firstrow"><!-- --></a>
<table border="0" cellpadding="0" cellspacing="3">
  <tr align="center" valign="top">
  
  
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-summary.html"><font class="NavBarFont1"><b>Overview</b></font></a>&nbsp;</td>
  <td bgcolor="#FFFFFF" class="NavBarCell1Rev">	&nbsp;<font class="NavBarFont1Rev"><b>File</b></font>&nbsp;</td>
  

  <td bgcolor="#FFFFFF" class="NavBarCell1"> 	<font class="NavBarFont1">Class</font>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-tree.html"><font class="NavBarFont1"><b>Tree</b></font></a>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="index-all.html"--><font class="NavBarFont1"><b>Index</b></font></a>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="help-doc.html"><font class="NavBarFont1"><b>Help</b></font></a>&nbsp;</td>
  </tr>
</table>
</td>
<td bgcolor="#EEEEFF" align="right" valign="top">
<em>
<b></b></em>
</td>
</tr>

<tr>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
&nbsp;PREV&nbsp;
&nbsp;NEXT</font></td>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
  <a href="index.html" target="_top"><b>FRAMES</b></a>  &nbsp;
&nbsp;<a href="overview-summary.html" target="_top"><b>NO FRAMES</b></a>
&nbsp;&nbsp;
<script>
  <!--
  if(window==top) {
    document.writeln('<A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>');
  }
  //-->
</script>
<noscript>
<a href="allclasses-noframe.html" target=""><b>All Classes</b></a>
</noscript>
</font></td>
</tr>
</table>
<!-- =========== END OF NAVBAR =========== -->

<hr>
<center>
	
	   <h2>events.js</h2>
	
</center>

	


<h4>Summary</h4>
<p>
	
		No overview generated for 'events.js'<BR/><BR/>
	
</p>

<hr>


    <table border="1" cellpadding="3" cellspacing="0" width="100%">
    <tr bgcolor="#CCCCFF" class="TableHeadingColor">
    <td colspan=2><font size="+2">
    
        <b>Class Summary</b>
    
    </font></td>
    </tr>
    
    <tr bgcolor="white" class="TableRowColor">
    <td width="15%"><b><a href="draw2d/AbstractEvent.html">draw2d.AbstractEvent</a></b></td>
    <td>&nbsp;</td>
    </tr>
    
    <tr bgcolor="white" class="TableRowColor">
    <td width="15%"><b><a href="draw2d/EventTarget.html">draw2d.EventTarget</a></b></td>
    <td>&nbsp;</td>
    </tr>
    
    </table>
    <hr/> 


<!-- ========== METHOD SUMMARY =========== -->

	<a name="method_summary"><!-- --></a>
	<table border="1" cellpadding="3" cellspacing="0" width="100%">
		<tr bgcolor="#CCCCFF" class="TableHeadingColor">
			<td colspan=2>
				<font size="+2">
					<b>Method Summary</b>
				</font>
			</td>
		</tr>
	
		
		   <tr bgcolor="white" class="TableRowColor">
		      <td align="right" valign="top" width="1%">
			 <font size="-1">
			    <code>static&nbsp;void</code>
			 </font>
		      </td>
		      <td>
			 <code>
			    <b>
			       <a href="GLOBALS.html#!s!pushErrorStack">pushErrorStack</a></b>( e, functionName)
			 </code>
			 <br>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 
		      </td>
		   </tr>
		
	
	</table>
    <p>

<!-- ========== END METHOD SUMMARY =========== -->


        <pre class="sourceview"><span class="comment">/* This notice must be untouched at all times.

FreeGroup Draw2D 0.9.26
The latest version is available at
http://www.freegroup.de

Copyright (c) 2006 Andreas Herz. All rights reserved.
Created 5. 11. 2006 by Andreas Herz (Web: http://www.freegroup.de )

LICENSE: LGPL

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License (LGPL) as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA,
or see http://www.gnu.org/copyleft/lesser.html
*/</span>
var draw2d = new Object();

var _errorStack_=[]
<span class="reserved">function</span> pushErrorStack(<span class="comment">/*:Exception*/</span> e, <span class="comment">/*:String*/</span> functionName)
{
  _errorStack_.push(functionName+<span class="literal">"\n"</span>);
  <span class="comment">/*re*/</span>throw e;
};


draw2d.AbstractEvent=<span class="reserved">function</span>() 
{

    <span class="comment">/**
     * The type of event.
     * <span class="attrib">@scope</span> public
     */</span>
    <span class="reserved">this</span>.type <span class="comment">/*: String */</span>   = null;


    <span class="comment">/**
     * The object that caused the event.
     * <span class="attrib">@scope</span> public
     */</span>
    <span class="reserved">this</span>.target <span class="comment">/*: EventTarget */</span> = null;

    <span class="comment">/**
     * A secondary object related to the event.
     * <span class="attrib">@scope</span> public
     */</span>
    <span class="reserved">this</span>.relatedTarget <span class="comment">/*: EventTarget */</span> = null;

    <span class="comment">/**
     * Indicates whether or not the event can be canceled.
     * <span class="attrib">@scope</span> public
     */</span>
    <span class="reserved">this</span>.cancelable <span class="comment">/*: boolean */</span> = false;
    
    <span class="comment">/**
     * The time that the event occurred.
     * <span class="attrib">@scope</span> public
     */</span>
    <span class="reserved">this</span>.timeStamp <span class="comment">/*: long */</span> = null;
    
    <span class="comment">/*
     * Set to false to cancel event.
     * <span class="attrib">@scope</span> public
     */</span>
    <span class="reserved">this</span>.returnValue <span class="comment">/*: boolean */</span> = true;    
};

<span class="comment">/**
 * Initializes the event object with information for the event.
 * <span class="attrib">@param</span> sType The type of event encapsulated by the object.
 * <span class="attrib">@param</span> bCancelable True if the event can be cancelled.
 */</span>
draw2d.AbstractEvent.<span class="reserved">prototype</span>.initEvent = <span class="reserved">function</span> (sType <span class="comment">/*: String */</span>,
                                       bCancelable <span class="comment">/*: boolean */</span>) {
    <span class="reserved">this</span>.type = sType;
    <span class="reserved">this</span>.cancelable = bCancelable;
    <span class="reserved">this</span>.timeStamp = (new Date()).getTime();
};

<span class="comment">/**
 * Prevents the default behavior for an event.
 */</span>
draw2d.AbstractEvent.<span class="reserved">prototype</span>.preventDefault = <span class="reserved">function</span> () 
{
    <span class="reserved">if</span> (<span class="reserved">this</span>.cancelable) {
        <span class="reserved">this</span>.returnValue = false;
    }
};

<span class="comment">/**
 * Static function. Don't use 'prototype'.
 **/</span>
draw2d.AbstractEvent.fireDOMEvent = <span class="reserved">function</span>(eventType, element)
{
    <span class="reserved">if</span> (document.createEvent)
    {
        var evt = document.createEvent(<span class="literal">"Events"</span>);
        evt.initEvent(eventType, true, true);
        element.dispatchEvent(evt);
    } <span class="reserved">else</span> <span class="reserved">if</span> (document.createEventObject) {
        var evt = document.createEventObject();
        element.fireEvent(<span class="literal">'on'</span> + eventType, evt);
    }
};

<span class="comment">/**
 * Any class that wants to support events should inherit from this.
 * <span class="attrib">@class</span>
 * <span class="attrib">@scope</span> public
 */</span>
draw2d.EventTarget=<span class="reserved">function</span>() 
{

    <span class="comment">/**
     * Array of event handlers.
     * <span class="attrib">@scope</span> private
     */</span>
    <span class="reserved">this</span>.eventhandlers = {};
};

<span class="comment">/**
 * Adds an event listener function to handle the type of event.
 * <span class="attrib">@scope</span> public
 * <span class="attrib">@param</span> sType The type of event to handle (i.e., "mousemove", not "onmousemove").
 * <span class="attrib">@param</span> fnListener The listener function for the event.
 */</span>
draw2d.EventTarget.<span class="reserved">prototype</span>.addEventListener = <span class="reserved">function</span> (sType <span class="comment">/*: String */</span>,
                                                    fnListener <span class="comment">/*: Function */</span>) {
    <span class="reserved">if</span> (typeof <span class="reserved">this</span>.eventhandlers[sType] == <span class="literal">"undefined"</span>) {
        <span class="reserved">this</span>.eventhandlers[sType] = [];
    }

    <span class="reserved">this</span>.eventhandlers[sType][<span class="reserved">this</span>.eventhandlers[sType].length] = fnListener;
};

<span class="comment">/**
 * Causes an event to fire.
 * <span class="attrib">@scope</span> public
 * <span class="attrib">@param</span> oEvent The event object containing information about the event to fire.
 * <span class="attrib">@return</span> True if the event should continue, false if not.
 */</span>
draw2d.EventTarget.<span class="reserved">prototype</span>.dispatchEvent = <span class="reserved">function</span> (oEvent <span class="comment">/*: Event */</span>) <span class="comment">/*: boolean */</span> {

    <span class="comment">/*
     * Set the target of the event.
     */</span>
    oEvent.target = <span class="reserved">this</span>;

    <span class="comment">/*
     * Call each event handler and pass in the event object.
     */</span>
<span class="comment">//  console.log(oEvent.type);</span>
    <span class="reserved">if</span> (typeof <span class="reserved">this</span>.eventhandlers[oEvent.type] != <span class="literal">"undefined"</span>) 
    {
        <span class="reserved">for</span> (var i=0; i &lt; <span class="reserved">this</span>.eventhandlers[oEvent.type].length; i++) 
        {
            <span class="reserved">this</span>.eventhandlers[oEvent.type][i](oEvent);
        }
    }

    <span class="comment">/*
     * Return the value of returnValue, which is changed to false
     * when preventDefault() is called.
     */</span>
    <span class="reserved">return</span> oEvent.returnValue;
};

<span class="comment">/**
 * Removes an event listener function from handling the type of event.
 * <span class="attrib">@scope</span> public
 * <span class="attrib">@param</span> sType The type of event to remove from (i.e., "mousemove", not "onmousemove").
 * <span class="attrib">@param</span> fnListener The listener function to remove.
 */</span>
draw2d.EventTarget.<span class="reserved">prototype</span>.removeEventListener = <span class="reserved">function</span> (sType <span class="comment">/*: String */</span>,
                                                       fnListener <span class="comment">/*: Function */</span>) {
    <span class="reserved">if</span> (typeof <span class="reserved">this</span>.eventhandlers[sType] != <span class="literal">"undefined"</span>) {
        var arrTemp = [];
        <span class="reserved">for</span> (var i=0; i &lt; <span class="reserved">this</span>.eventhandlers[sType].length; i++) {
            <span class="reserved">if</span> (<span class="reserved">this</span>.eventhandlers[sType][i] != fnListener) {
                arrTemp[arrTemp.length] = <span class="reserved">this</span>.eventhandlers[sType][i];
            }
        }
        <span class="reserved">this</span>.eventhandlers[sType] = arrTemp;
    }
};
</pre>
	<hr>



<!-- ========== START OF NAVBAR ========== -->
<a name="navbar_top"><!-- --></a>
<table border="0" width="100%" cellpadding="1" cellspacing="0">
<tr>
<td colspan=2 bgcolor="#EEEEFF" class="NavBarCell1">
<a name="navbar_top_firstrow"><!-- --></a>
<table border="0" cellpadding="0" cellspacing="3">
  <tr align="center" valign="top">
  
  
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-summary.html"><font class="NavBarFont1"><b>Overview</b></font></a>&nbsp;</td>
  <td bgcolor="#FFFFFF" class="NavBarCell1Rev">	&nbsp;<font class="NavBarFont1Rev"><b>File</b></font>&nbsp;</td>
  

  <td bgcolor="#FFFFFF" class="NavBarCell1"> <font class="NavBarFont1">Class</font>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-tree.html"><font class="NavBarFont1"><b>Tree</b></font></a>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="index-all.html"--><font class="NavBarFont1"><b>Index</b></font></a>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="help-doc.html"><font class="NavBarFont1"><b>Help</b></font></a>&nbsp;</td>
  </tr>
</table>
</td>
<td bgcolor="#EEEEFF" align="right" valign="top"><em>
<b></b></em>
</td>
</tr>

<tr>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
&nbsp;PREV&nbsp;
&nbsp;NEXT</font></td>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
  <a href="index.html" target="_top"><b>FRAMES</b></a>  &nbsp;
&nbsp;<a href="overview-summary.html" target="_top"><b>NO FRAMES</b></a>
&nbsp;&nbsp;
<script>
  <!--
  if(window==top) {
    document.writeln('<A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>');
  }
  //-->
</script>
<noscript>
<a href="allclasses-noframe.html" target=""><b>All Classes</b></a>
</noscript>
</font></td>
</tr>
</table>
<!-- =========== END OF NAVBAR =========== -->

<hr>
<font size="-1">

</font>
<div class="jsdoc_ctime">Documentation generated by <a href="http://jsdoc.sourceforge.net/" target="_parent">JSDoc</a> on Mon Nov 14 13:45:39 2011</div>
</body>
</html>
